package com.thingsgrid.device.wrapper;
import com.thingsgrid.device.entity.Product;
import com.thingsgrid.device.vo.ProductVO;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2019-08-19
 */
@AllArgsConstructor
public class ProductWrapper extends BaseEntityWrapper<Product, ProductVO> {

//	private IDictClient dictClient;

	@Override
	public ProductVO entityVO(Product product) {
		ProductVO productVO = BeanUtil.copy(product, ProductVO.class);

		/*R<String> dict = dictClient.getValue("product" , productVO.getCategory());
		if (dict.isSuccess()) {
			String categoryName = dict.getData();
			productVO.setCategoryName(categoryName);
		}*/

		return productVO;
	}

}
